<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
    #h2{
        border: rgb(242, 255, 0) solid;
    }
</style>
</head>
<body>
    <h2 id="h2" hidden>封校三天 快乐无边</h2>
    <button onclick="fn()">点击</button>

    <script>
        //有个button,有个h2(封校三天 快乐无边),当点击button时会显示文字，再次点击会文字会消失。
        function fn(){
            var newH2 = document.getElementById('h2');
            newH2.hidden = !newH2.hidden;
         
        }
    </script>


</body>
</html>